package com.personal.ifanya.application.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.stereotype.Service;

import com.personal.ifanya.application.dto.NewsDTO;
import com.personal.ifanya.domain.NewsBiz;
import com.personal.ifanya.infrastructure.dal.dao.ItemDAO;

@Service
public class NewsService {

	  
	@Autowired
	private NewsBiz newsBiz;
	
	
	public List<NewsDTO> getNewsList(int type)
	{
		return newsBiz.getNewsList(type);
		
	}
	
	public NewsDTO getByItemId(int itemId)
	{
		return newsBiz.getByItemId(itemId);
	}
	
	public List<NewsDTO> getLatestNews()
	{
		return newsBiz.getLatestNews(); 
	}
	
	public boolean insert(NewsDTO newsDTO)
	{
		if(newsBiz.insert(newsDTO)>0)
			return true;
		else
			return false;
	}
	
}
